
#include "TVserver.h"
#include <pthread.h>
#include <stdio.h>
//string LOCAL_IPADDR = "202.116.76.56";

int main(int argc, char* argv[])
{
	char arg[3][32];
	if(argc == 4){
		strcpy(arg[0], argv[1]);
		strcpy(arg[1], argv[2]);
		strcpy(arg[2], argv[3]);
	}else{
		FILE* in;
		char* re;
		char tmp[256];
		in = fopen("server_set.log", "r");
		re = fgets(tmp, 255, in);
		if(in == NULL){
			debug_log(ERR, "init ERROR: cant open file");
			exit(1);
		}
		sscanf(tmp, "%s %s %s", &arg[0], &arg[1], &arg[2]);
		fclose(in);
	}
	//------------------------------------------
	CPeerCtrl tmp(arg[0], arg[1], arg[2]);
	tmp.listenMessage(5, -1);
	return 0;
}
